using UnityEngine;
using System.Collections;

public class Arrastar : MonoBehaviour {
	
	// Use this for initialization
	void Start () 
	{
	
	}
	
	// Update is called once per frame
	void Update () 
	{
		Ray ray = Camera.mainCamera.ScreenPointToRay(Input.mousePosition);
		RaycastHit hit;
		Vector3 posicao;
	
		if(Physics.Raycast(ray,out hit,Mathf.Infinity))
		{
			posicao.y = transform.position.y;
			posicao.x = hit.point.x;
			posicao.z = hit.point.z;
			
			transform.position = posicao;
		}
	}
}
